package edu.mse.camel.client.whiteboard.diagram.part;

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.notation.View;

import edu.mse.camel.client.whiteboard.Cylinder;
import edu.mse.camel.client.whiteboard.DashArrowConn;
import edu.mse.camel.client.whiteboard.DashConn;
import edu.mse.camel.client.whiteboard.DashDoubleArrowConn;
import edu.mse.camel.client.whiteboard.Diagram;
import edu.mse.camel.client.whiteboard.Diamond;
import edu.mse.camel.client.whiteboard.Ellipse;
import edu.mse.camel.client.whiteboard.Rectangle;
import edu.mse.camel.client.whiteboard.RoundedRectangle;
import edu.mse.camel.client.whiteboard.Shape;
import edu.mse.camel.client.whiteboard.SolidArrowConn;
import edu.mse.camel.client.whiteboard.SolidConn;
import edu.mse.camel.client.whiteboard.SolidDoubleArrowConn;
import edu.mse.camel.client.whiteboard.WhiteboardPackage;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.CylinderEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.DashArrowConnEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.DashConnEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.DashDoubleArrowConnEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.DiagramEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.DiamondEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.EllipseEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.RectangleEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.RoundedRectangleEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.SolidArrowConnEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.SolidConnEditPart;
import edu.mse.camel.client.whiteboard.diagram.edit.parts.SolidDoubleArrowConnEditPart;
import edu.mse.camel.client.whiteboard.diagram.providers.WhiteboardElementTypes;

/**
 * @generated
 */
public class WhiteboardDiagramUpdater {

	/**
	 * @generated
	 */
	public static List getSemanticChildren(View view) {
		switch (WhiteboardVisualIDRegistry.getVisualID(view)) {
		case DiagramEditPart.VISUAL_ID:
			return getDiagram_79SemanticChildren(view);
		}
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDiagram_79SemanticChildren(View view) {
		if (!view.isSetElement()) {
			return Collections.EMPTY_LIST;
		}
		Diagram modelElement = (Diagram) view.getElement();
		List result = new LinkedList();
		for (Iterator it = modelElement.getShapes().iterator(); it.hasNext();) {
			Shape childElement = (Shape) it.next();
			int visualID = WhiteboardVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == CylinderEditPart.VISUAL_ID) {
				result
						.add(new WhiteboardNodeDescriptor(childElement,
								visualID));
				continue;
			}
			if (visualID == EllipseEditPart.VISUAL_ID) {
				result
						.add(new WhiteboardNodeDescriptor(childElement,
								visualID));
				continue;
			}
			if (visualID == RectangleEditPart.VISUAL_ID) {
				result
						.add(new WhiteboardNodeDescriptor(childElement,
								visualID));
				continue;
			}
			if (visualID == DiamondEditPart.VISUAL_ID) {
				result
						.add(new WhiteboardNodeDescriptor(childElement,
								visualID));
				continue;
			}
			if (visualID == RoundedRectangleEditPart.VISUAL_ID) {
				result
						.add(new WhiteboardNodeDescriptor(childElement,
								visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List getContainedLinks(View view) {
		switch (WhiteboardVisualIDRegistry.getVisualID(view)) {
		case DiagramEditPart.VISUAL_ID:
			return getDiagram_79ContainedLinks(view);
		case CylinderEditPart.VISUAL_ID:
			return getCylinder_1001ContainedLinks(view);
		case EllipseEditPart.VISUAL_ID:
			return getEllipse_1002ContainedLinks(view);
		case RectangleEditPart.VISUAL_ID:
			return getRectangle_1003ContainedLinks(view);
		case DiamondEditPart.VISUAL_ID:
			return getDiamond_1004ContainedLinks(view);
		case RoundedRectangleEditPart.VISUAL_ID:
			return getRoundedRectangle_1005ContainedLinks(view);
		case SolidConnEditPart.VISUAL_ID:
			return getSolidConn_3001ContainedLinks(view);
		case SolidArrowConnEditPart.VISUAL_ID:
			return getSolidArrowConn_3002ContainedLinks(view);
		case SolidDoubleArrowConnEditPart.VISUAL_ID:
			return getSolidDoubleArrowConn_3003ContainedLinks(view);
		case DashConnEditPart.VISUAL_ID:
			return getDashConn_3004ContainedLinks(view);
		case DashArrowConnEditPart.VISUAL_ID:
			return getDashArrowConn_3005ContainedLinks(view);
		case DashDoubleArrowConnEditPart.VISUAL_ID:
			return getDashDoubleArrowConn_3006ContainedLinks(view);
		}
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getIncomingLinks(View view) {
		switch (WhiteboardVisualIDRegistry.getVisualID(view)) {
		case CylinderEditPart.VISUAL_ID:
			return getCylinder_1001IncomingLinks(view);
		case EllipseEditPart.VISUAL_ID:
			return getEllipse_1002IncomingLinks(view);
		case RectangleEditPart.VISUAL_ID:
			return getRectangle_1003IncomingLinks(view);
		case DiamondEditPart.VISUAL_ID:
			return getDiamond_1004IncomingLinks(view);
		case RoundedRectangleEditPart.VISUAL_ID:
			return getRoundedRectangle_1005IncomingLinks(view);
		case SolidConnEditPart.VISUAL_ID:
			return getSolidConn_3001IncomingLinks(view);
		case SolidArrowConnEditPart.VISUAL_ID:
			return getSolidArrowConn_3002IncomingLinks(view);
		case SolidDoubleArrowConnEditPart.VISUAL_ID:
			return getSolidDoubleArrowConn_3003IncomingLinks(view);
		case DashConnEditPart.VISUAL_ID:
			return getDashConn_3004IncomingLinks(view);
		case DashArrowConnEditPart.VISUAL_ID:
			return getDashArrowConn_3005IncomingLinks(view);
		case DashDoubleArrowConnEditPart.VISUAL_ID:
			return getDashDoubleArrowConn_3006IncomingLinks(view);
		}
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getOutgoingLinks(View view) {
		switch (WhiteboardVisualIDRegistry.getVisualID(view)) {
		case CylinderEditPart.VISUAL_ID:
			return getCylinder_1001OutgoingLinks(view);
		case EllipseEditPart.VISUAL_ID:
			return getEllipse_1002OutgoingLinks(view);
		case RectangleEditPart.VISUAL_ID:
			return getRectangle_1003OutgoingLinks(view);
		case DiamondEditPart.VISUAL_ID:
			return getDiamond_1004OutgoingLinks(view);
		case RoundedRectangleEditPart.VISUAL_ID:
			return getRoundedRectangle_1005OutgoingLinks(view);
		case SolidConnEditPart.VISUAL_ID:
			return getSolidConn_3001OutgoingLinks(view);
		case SolidArrowConnEditPart.VISUAL_ID:
			return getSolidArrowConn_3002OutgoingLinks(view);
		case SolidDoubleArrowConnEditPart.VISUAL_ID:
			return getSolidDoubleArrowConn_3003OutgoingLinks(view);
		case DashConnEditPart.VISUAL_ID:
			return getDashConn_3004OutgoingLinks(view);
		case DashArrowConnEditPart.VISUAL_ID:
			return getDashArrowConn_3005OutgoingLinks(view);
		case DashDoubleArrowConnEditPart.VISUAL_ID:
			return getDashDoubleArrowConn_3006OutgoingLinks(view);
		}
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDiagram_79ContainedLinks(View view) {
		Diagram modelElement = (Diagram) view.getElement();
		List result = new LinkedList();
		result
				.addAll(getContainedTypeModelFacetLinks_SolidConn_3001(modelElement));
		result
				.addAll(getContainedTypeModelFacetLinks_SolidArrowConn_3002(modelElement));
		result
				.addAll(getContainedTypeModelFacetLinks_SolidDoubleArrowConn_3003(modelElement));
		result
				.addAll(getContainedTypeModelFacetLinks_DashConn_3004(modelElement));
		result
				.addAll(getContainedTypeModelFacetLinks_DashArrowConn_3005(modelElement));
		result
				.addAll(getContainedTypeModelFacetLinks_DashDoubleArrowConn_3006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getCylinder_1001ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getEllipse_1002ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getRectangle_1003ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDiamond_1004ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getRoundedRectangle_1005ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getSolidConn_3001ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getSolidArrowConn_3002ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getSolidDoubleArrowConn_3003ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDashConn_3004ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDashArrowConn_3005ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDashDoubleArrowConn_3006ContainedLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getCylinder_1001IncomingLinks(View view) {
		Cylinder modelElement = (Cylinder) view.getElement();
		Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource()
				.getResourceSet().getResources());
		List result = new LinkedList();
		result.addAll(getIncomingTypeModelFacetLinks_SolidConn_3001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_SolidArrowConn_3002(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_SolidDoubleArrowConn_3003(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashConn_3004(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashArrowConn_3005(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashDoubleArrowConn_3006(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getEllipse_1002IncomingLinks(View view) {
		Ellipse modelElement = (Ellipse) view.getElement();
		Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource()
				.getResourceSet().getResources());
		List result = new LinkedList();
		result.addAll(getIncomingTypeModelFacetLinks_SolidConn_3001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_SolidArrowConn_3002(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_SolidDoubleArrowConn_3003(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashConn_3004(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashArrowConn_3005(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashDoubleArrowConn_3006(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getRectangle_1003IncomingLinks(View view) {
		Rectangle modelElement = (Rectangle) view.getElement();
		Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource()
				.getResourceSet().getResources());
		List result = new LinkedList();
		result.addAll(getIncomingTypeModelFacetLinks_SolidConn_3001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_SolidArrowConn_3002(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_SolidDoubleArrowConn_3003(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashConn_3004(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashArrowConn_3005(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashDoubleArrowConn_3006(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getDiamond_1004IncomingLinks(View view) {
		Diamond modelElement = (Diamond) view.getElement();
		Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource()
				.getResourceSet().getResources());
		List result = new LinkedList();
		result.addAll(getIncomingTypeModelFacetLinks_SolidConn_3001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_SolidArrowConn_3002(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_SolidDoubleArrowConn_3003(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashConn_3004(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashArrowConn_3005(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashDoubleArrowConn_3006(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getRoundedRectangle_1005IncomingLinks(View view) {
		RoundedRectangle modelElement = (RoundedRectangle) view.getElement();
		Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource()
				.getResourceSet().getResources());
		List result = new LinkedList();
		result.addAll(getIncomingTypeModelFacetLinks_SolidConn_3001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_SolidArrowConn_3002(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_SolidDoubleArrowConn_3003(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashConn_3004(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashArrowConn_3005(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_DashDoubleArrowConn_3006(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getSolidConn_3001IncomingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getSolidArrowConn_3002IncomingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getSolidDoubleArrowConn_3003IncomingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDashConn_3004IncomingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDashArrowConn_3005IncomingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDashDoubleArrowConn_3006IncomingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getCylinder_1001OutgoingLinks(View view) {
		Cylinder modelElement = (Cylinder) view.getElement();
		List result = new LinkedList();
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidConn_3001(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidArrowConn_3002(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidDoubleArrowConn_3003(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashConn_3004(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashArrowConn_3005(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashDoubleArrowConn_3006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getEllipse_1002OutgoingLinks(View view) {
		Ellipse modelElement = (Ellipse) view.getElement();
		List result = new LinkedList();
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidConn_3001(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidArrowConn_3002(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidDoubleArrowConn_3003(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashConn_3004(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashArrowConn_3005(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashDoubleArrowConn_3006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getRectangle_1003OutgoingLinks(View view) {
		Rectangle modelElement = (Rectangle) view.getElement();
		List result = new LinkedList();
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidConn_3001(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidArrowConn_3002(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidDoubleArrowConn_3003(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashConn_3004(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashArrowConn_3005(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashDoubleArrowConn_3006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getDiamond_1004OutgoingLinks(View view) {
		Diamond modelElement = (Diamond) view.getElement();
		List result = new LinkedList();
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidConn_3001(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidArrowConn_3002(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidDoubleArrowConn_3003(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashConn_3004(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashArrowConn_3005(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashDoubleArrowConn_3006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getRoundedRectangle_1005OutgoingLinks(View view) {
		RoundedRectangle modelElement = (RoundedRectangle) view.getElement();
		List result = new LinkedList();
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidConn_3001(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidArrowConn_3002(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_SolidDoubleArrowConn_3003(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashConn_3004(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashArrowConn_3005(modelElement));
		result
				.addAll(getOutgoingTypeModelFacetLinks_DashDoubleArrowConn_3006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List getSolidConn_3001OutgoingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getSolidArrowConn_3002OutgoingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getSolidDoubleArrowConn_3003OutgoingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDashConn_3004OutgoingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDashArrowConn_3005OutgoingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	public static List getDashDoubleArrowConn_3006OutgoingLinks(View view) {
		return Collections.EMPTY_LIST;
	}

	/**
	 * @generated
	 */
	private static Collection getContainedTypeModelFacetLinks_SolidConn_3001(
			Diagram container) {
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof SolidConn) {
				continue;
			}
			SolidConn link = (SolidConn) linkObject;
			if (SolidConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getTarget();
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.SolidConn_3001,
					SolidConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getContainedTypeModelFacetLinks_SolidArrowConn_3002(
			Diagram container) {
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof SolidArrowConn) {
				continue;
			}
			SolidArrowConn link = (SolidArrowConn) linkObject;
			if (SolidArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getTarget();
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.SolidArrowConn_3002,
					SolidArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getContainedTypeModelFacetLinks_SolidDoubleArrowConn_3003(
			Diagram container) {
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof SolidDoubleArrowConn) {
				continue;
			}
			SolidDoubleArrowConn link = (SolidDoubleArrowConn) linkObject;
			if (SolidDoubleArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getTarget();
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.SolidDoubleArrowConn_3003,
					SolidDoubleArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getContainedTypeModelFacetLinks_DashConn_3004(
			Diagram container) {
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof DashConn) {
				continue;
			}
			DashConn link = (DashConn) linkObject;
			if (DashConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getSource();
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.DashConn_3004,
					DashConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getContainedTypeModelFacetLinks_DashArrowConn_3005(
			Diagram container) {
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof DashArrowConn) {
				continue;
			}
			DashArrowConn link = (DashArrowConn) linkObject;
			if (DashArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getSource();
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.DashArrowConn_3005,
					DashArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getContainedTypeModelFacetLinks_DashDoubleArrowConn_3006(
			Diagram container) {
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof DashDoubleArrowConn) {
				continue;
			}
			DashDoubleArrowConn link = (DashDoubleArrowConn) linkObject;
			if (DashDoubleArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getTarget();
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.DashDoubleArrowConn_3006,
					DashDoubleArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getIncomingTypeModelFacetLinks_SolidConn_3001(
			Shape target, Map crossReferences) {
		Collection result = new LinkedList();
		Collection settings = (Collection) crossReferences.get(target);
		for (Iterator it = settings.iterator(); it.hasNext();) {
			EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it
					.next();
			if (setting.getEStructuralFeature() != WhiteboardPackage.eINSTANCE
					.getConnection_Target()
					|| false == setting.getEObject() instanceof SolidConn) {
				continue;
			}
			SolidConn link = (SolidConn) setting.getEObject();
			if (SolidConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, target, link,
					WhiteboardElementTypes.SolidConn_3001,
					SolidConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getIncomingTypeModelFacetLinks_SolidArrowConn_3002(
			Shape target, Map crossReferences) {
		Collection result = new LinkedList();
		Collection settings = (Collection) crossReferences.get(target);
		for (Iterator it = settings.iterator(); it.hasNext();) {
			EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it
					.next();
			if (setting.getEStructuralFeature() != WhiteboardPackage.eINSTANCE
					.getConnection_Target()
					|| false == setting.getEObject() instanceof SolidArrowConn) {
				continue;
			}
			SolidArrowConn link = (SolidArrowConn) setting.getEObject();
			if (SolidArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, target, link,
					WhiteboardElementTypes.SolidArrowConn_3002,
					SolidArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getIncomingTypeModelFacetLinks_SolidDoubleArrowConn_3003(
			Shape target, Map crossReferences) {
		Collection result = new LinkedList();
		Collection settings = (Collection) crossReferences.get(target);
		for (Iterator it = settings.iterator(); it.hasNext();) {
			EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it
					.next();
			if (setting.getEStructuralFeature() != WhiteboardPackage.eINSTANCE
					.getConnection_Target()
					|| false == setting.getEObject() instanceof SolidDoubleArrowConn) {
				continue;
			}
			SolidDoubleArrowConn link = (SolidDoubleArrowConn) setting
					.getEObject();
			if (SolidDoubleArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, target, link,
					WhiteboardElementTypes.SolidDoubleArrowConn_3003,
					SolidDoubleArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getIncomingTypeModelFacetLinks_DashConn_3004(
			Shape target, Map crossReferences) {
		Collection result = new LinkedList();
		Collection settings = (Collection) crossReferences.get(target);
		for (Iterator it = settings.iterator(); it.hasNext();) {
			EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it
					.next();
			if (setting.getEStructuralFeature() != WhiteboardPackage.eINSTANCE
					.getConnection_Source()
					|| false == setting.getEObject() instanceof DashConn) {
				continue;
			}
			DashConn link = (DashConn) setting.getEObject();
			if (DashConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, target, link,
					WhiteboardElementTypes.DashConn_3004,
					DashConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getIncomingTypeModelFacetLinks_DashArrowConn_3005(
			Shape target, Map crossReferences) {
		Collection result = new LinkedList();
		Collection settings = (Collection) crossReferences.get(target);
		for (Iterator it = settings.iterator(); it.hasNext();) {
			EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it
					.next();
			if (setting.getEStructuralFeature() != WhiteboardPackage.eINSTANCE
					.getConnection_Source()
					|| false == setting.getEObject() instanceof DashArrowConn) {
				continue;
			}
			DashArrowConn link = (DashArrowConn) setting.getEObject();
			if (DashArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, target, link,
					WhiteboardElementTypes.DashArrowConn_3005,
					DashArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getIncomingTypeModelFacetLinks_DashDoubleArrowConn_3006(
			Shape target, Map crossReferences) {
		Collection result = new LinkedList();
		Collection settings = (Collection) crossReferences.get(target);
		for (Iterator it = settings.iterator(); it.hasNext();) {
			EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it
					.next();
			if (setting.getEStructuralFeature() != WhiteboardPackage.eINSTANCE
					.getConnection_Target()
					|| false == setting.getEObject() instanceof DashDoubleArrowConn) {
				continue;
			}
			DashDoubleArrowConn link = (DashDoubleArrowConn) setting
					.getEObject();
			if (DashDoubleArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape src = link.getSource();
			result.add(new WhiteboardLinkDescriptor(src, target, link,
					WhiteboardElementTypes.DashDoubleArrowConn_3006,
					DashDoubleArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getOutgoingTypeModelFacetLinks_SolidConn_3001(
			Shape source) {
		Diagram container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Diagram) {
				container = (Diagram) element;
			}
		}
		if (container == null) {
			return Collections.EMPTY_LIST;
		}
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof SolidConn) {
				continue;
			}
			SolidConn link = (SolidConn) linkObject;
			if (SolidConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getTarget();
			Shape src = link.getSource();
			if (src != source) {
				continue;
			}
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.SolidConn_3001,
					SolidConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getOutgoingTypeModelFacetLinks_SolidArrowConn_3002(
			Shape source) {
		Diagram container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Diagram) {
				container = (Diagram) element;
			}
		}
		if (container == null) {
			return Collections.EMPTY_LIST;
		}
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof SolidArrowConn) {
				continue;
			}
			SolidArrowConn link = (SolidArrowConn) linkObject;
			if (SolidArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getTarget();
			Shape src = link.getSource();
			if (src != source) {
				continue;
			}
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.SolidArrowConn_3002,
					SolidArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getOutgoingTypeModelFacetLinks_SolidDoubleArrowConn_3003(
			Shape source) {
		Diagram container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Diagram) {
				container = (Diagram) element;
			}
		}
		if (container == null) {
			return Collections.EMPTY_LIST;
		}
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof SolidDoubleArrowConn) {
				continue;
			}
			SolidDoubleArrowConn link = (SolidDoubleArrowConn) linkObject;
			if (SolidDoubleArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getTarget();
			Shape src = link.getSource();
			if (src != source) {
				continue;
			}
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.SolidDoubleArrowConn_3003,
					SolidDoubleArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getOutgoingTypeModelFacetLinks_DashConn_3004(
			Shape source) {
		Diagram container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Diagram) {
				container = (Diagram) element;
			}
		}
		if (container == null) {
			return Collections.EMPTY_LIST;
		}
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof DashConn) {
				continue;
			}
			DashConn link = (DashConn) linkObject;
			if (DashConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getSource();
			Shape src = link.getSource();
			if (src != source) {
				continue;
			}
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.DashConn_3004,
					DashConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getOutgoingTypeModelFacetLinks_DashArrowConn_3005(
			Shape source) {
		Diagram container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Diagram) {
				container = (Diagram) element;
			}
		}
		if (container == null) {
			return Collections.EMPTY_LIST;
		}
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof DashArrowConn) {
				continue;
			}
			DashArrowConn link = (DashArrowConn) linkObject;
			if (DashArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getSource();
			Shape src = link.getSource();
			if (src != source) {
				continue;
			}
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.DashArrowConn_3005,
					DashArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection getOutgoingTypeModelFacetLinks_DashDoubleArrowConn_3006(
			Shape source) {
		Diagram container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Diagram) {
				container = (Diagram) element;
			}
		}
		if (container == null) {
			return Collections.EMPTY_LIST;
		}
		Collection result = new LinkedList();
		for (Iterator links = container.getConnections().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof DashDoubleArrowConn) {
				continue;
			}
			DashDoubleArrowConn link = (DashDoubleArrowConn) linkObject;
			if (DashDoubleArrowConnEditPart.VISUAL_ID != WhiteboardVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Shape dst = link.getTarget();
			Shape src = link.getSource();
			if (src != source) {
				continue;
			}
			result.add(new WhiteboardLinkDescriptor(src, dst, link,
					WhiteboardElementTypes.DashDoubleArrowConn_3006,
					DashDoubleArrowConnEditPart.VISUAL_ID));
		}
		return result;
	}

}
